package PTA;

import java.util.Scanner;

/**
 * @Auther: xujianfeng
 * @Date: 2018/11/25 22:58
 * @Description: PTA 第一题
 */
public class Format1001 {

//    public static void main(String[] args) {
//        Scanner sc = new Scanner(System.in);
//        int a = Integer.parseInt(sc.next());
//        int b = Integer.parseInt(sc.next());
//        int sum = a + b;
//        boolean one = false;
////        if(sum<0){
////            sum = -sum;
////            one = true;
////        }
//        StringBuilder sb = new StringBuilder((sum) + "");
//        int length = sb.length();
//        System.out.println(length);
//        int size = length / 3;
//        if (length % 3 == 0) {
//            size--;
//        }
//        System.out.println(size);
//        System.out.println(sb);
//        sb.reverse();
//        for (int i = 0; i < size; i++) {
//            int bb = 3 * (i + 1) + i;
//            System.out.println(sb.insert(bb, ","));
//
//        }
//        if (one) {
//            sb.append("-");
//        }
//        System.out.println(sb.reverse());
//    }


    public static void main(String[] args) {
        test1();
    }
    public static  void test1() {

        for (int a = -999; a < 999; a++) {
            for (int b = -999; b < 999; b++) {
                int sum = a + b;
                StringBuilder sb = new StringBuilder((sum) + "");
                int length = sb.length();
                if(sum<0){
                    length--;
                }
                int size = length / 3;

                if (length % 3 == 0) {
                    size--;
                }
                sb.reverse();
                for (int i = 0; i < size; i++) {
                    int bb = 3 * (i + 1) + i;
                    sb.insert(bb, ",");

                }
                System.out.println(a+"   "+b+"   "+sb.reverse());
            }

        }


    }
}
